package com.topsec.redis.test1;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SimpleRedis {


    @Autowired
    private RedisTemplate redisTemplate;

    @RequestMapping("/simpleRedis")
    public String test1() {
        redisTemplate.opsForValue().set("name7","777java");
        String str =(String) redisTemplate.opsForValue().get("name7");
        System.out.println(str);
        System.out.println((String) redisTemplate.opsForValue().get("java"));

        return "name7-->"+str;
    }
}
